package com.order.service.impl;

import com.order.dao.CustomerDao;
import com.order.pojo.Customer;
import com.order.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CustomerServiceImpl implements CustomerService {
    @Autowired
    private CustomerDao customerDao;
    @Override
    public Boolean submit(Customer customer) {
        return customerDao.submit(customer);
    }

    @Override
    public Customer login(String phone, String password) {
        return customerDao.login(phone,password);
    }

    @Override
    public Boolean updatePassword(String phone, String oldPass, String newPass) {
        return customerDao.updatePassword(phone, oldPass, newPass);
    }

    @Override
    public Boolean recharge(Integer id, Double money) {
        return customerDao.recharge(id,money);
    }

    @Override
    public Boolean pay(Integer id, Double money) {
        return customerDao.pay(id, money);
    }

    @Override
    public Boolean updateFlavorAndTaboo(Customer customer) {
        return customerDao.updateFlavorAndTaboo(customer);
    }

    @Override
    public List<Customer> findAllCustomers() {
        return customerDao.findAllCustomers();
    }
}
